package serves.Impl;

import Util.PageUtil;
import bean.TArea;
import bean.TInsect;
import dao.Impl.areaDaoImpl;
import dao.areaDao;
import serves.areaSev;

import java.util.List;

public class areaSevImpl implements areaSev {
    areaDao ad = new areaDaoImpl();

    @Override
    public List<TArea> arealist() {
        return ad.arealist();
    }

    @Override
    public PageUtil<TArea> ListByPage(int pageNo, int pageSize, String areaname) {
        List<TArea> bs = ad.ListByPage(pageNo, pageSize, areaname);
        System.out.println("bs.size() = " + bs.size());
        int count = ad.getListCount(areaname);
        PageUtil<TArea> areas = new PageUtil<>(bs, pageNo, pageSize, count);
        return areas;
    }

    @Override
    public boolean add(TArea area) {
        return ad.add(area);
    }

    @Override
    public boolean delete(TArea area) {
        return false;
    }

    @Override
    public TArea find(TArea area) {
        return null;
    }
}

